![]() |
StuffHex |
||||
Header: | Quickdraw.h | Carbon status: | Supported | |
Sets byte values into memory.
void StuffHex ( void *thingPtr, ConstStr255Param s );
A pointer to any data structure in memory. If thingPtr is an odd address, then thingPtr is interpreted as pointing to the next word boundary.
A string of characters representing hexadecimal digits. All characters in this string must be hexadecimal digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F). Otherwise, StuffHex may set bytes in the data structure pointed to by thingPtr to arbitrary values. If there are an odd number of characters in the string, the last character is ignored.
The StuffHex function sets bytes in memory beginning with that byte specified by the parameter thingPtr. The total number of bytes set is equivalent to half the length of the string, ignoring the last character if the number of characters is odd.
Each byte to be set corresponds to two characters in the string. These characters should represent hexadecimal digits. For example, the string ëD41A’ results in 2 bytes being set to the values $D4 and $1A, respectively.
To copy a range of bytes from one memory location to another, you should ordinarily use the Memory Manager function, BlockMove.
The StuffHex function does no range checking to ensure that bytes being set are within the bounds of a certain data structure. If you do not use StuffHex carefully, you may change memory in the partition of your application or another application in unpredictable ways.
Although the StuffHex function sets the value of individual bytes, it does not move relocatable blocks. Thus, you can call it at interrupt time.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)